package operation;

import book.BookList;

import java.util.Scanner;

public class Find implements IOPeration{
    @Override
    public void work(BookList bookList) {
        Scanner sc = new Scanner(System.in);
        System.out.print("请输入要查找书的名字:");
        String name = sc.nextLine();
        for (int i = 0; i < bookList.getBookNum(); i++) {
            if(name.equals(bookList.getBooklist()[i].getName())) {
                System.out.print("找到了->");
                System.out.println(bookList.getBooklist()[i]);
                return;
            }
        }
        System.out.println("没有找到改名字的书！！！");
    }
}
